package com.che.libcommon.ui.loading;


import android.view.View;
import android.view.View.OnClickListener;
import com.che.libcommon.ui.VOMessage;

/**
 * Created by zl on 2017/12/21.
 */

public interface ILoadingView {

  /**
   * 显示或隐藏loading
   * @param isShow
   */
  void showLoading(boolean isShow);


  /**
   * 显示异常
   * @param voError
   */
  void showError(VOMessage voError);

  /**
   * 显示数据前调用
   */
  void showData();


  LoadingConfigure getConfigure();

  interface LoadingConfigure{
    VOMessage getEmptyMessage();

    View.OnClickListener getOnEmptyClickClickListener();

    View.OnClickListener getOnRetryClickListener();

    OnLoadingShowCallback getOnLoadingShowCallback();
  }


  class SampleLoadingConfigure implements LoadingConfigure{

    @Override
    public VOMessage getEmptyMessage() {
      return null;
    }

    @Override
    public OnClickListener getOnEmptyClickClickListener() {
      return null;
    }

    @Override
    public OnClickListener getOnRetryClickListener() {
      return null;
    }

    @Override
    public OnLoadingShowCallback getOnLoadingShowCallback() {
      return null;
    }
  }


}
